project(PolarAlign)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake_modules/")
Include (CheckCXXSourceCompiles)
find_package(Qt4 REQUIRED)
find_package(INDI REQUIRED)
find_package(Nova REQUIRED)
find_package(ZLIB REQUIRED)

set(CATALOGS_INCLUDE_DIR "../Catalogs/")
set(CATALOG_LIB "/opt/builds/x86_64/indi-tools/catalogs/libCatalog.a")

set(HCINDI_INCLUDE_DIR "../Pad/")
set(HCINDI_LIB "/opt/builds/x86_64/indi-tools/pad/libHCINDI.a")
find_package(X11 REQUIRED)

include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${INDI_INCLUDE_DIR} ${NOVA_INCLUDE_DIR} ${CATALOGS_INCLUDE_DIR} ${HCINDI_INCLUDE_DIR})

set(PolarAlign_SRCS  TwoStarWizard.cpp StarSelect.cpp PolarAlign.cpp main.cpp)
set(PolarAlign_FORMS PolarAlign.ui Servers.ui)
set(PolarAlign_HEADERS  PolarAlign.h StarSelect.h TwoStarWizard.h)
#set(PolarAlign_RESOURCES ../Pad/res_pad.qrc)

qt4_wrap_cpp(PolarAlign_HEADERS_MOC ${PolarAlign_HEADERS})
qt4_wrap_ui(PolarAlign_FORMS_HEADERS ${PolarAlign_FORMS})
#qt4_add_resources(PolarAlign_RESOURCES_RCC ${PolarAlign_RESOURCES})

add_executable(PolarAlign ${PolarAlign_SRCS} ${PolarAlign_HEADERS_MOC} ${PolarAlign_FORMS_HEADERS} ) #${PolarAlign_RESOURCES_RCC})
target_link_libraries(PolarAlign ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${INDI_LIBRARIES} ${INDI_CLIENT_LIBRARIES} ${NOVA_LIBRARIES} ${ZLIB_LIBRARY} ${CATALOG_LIB} ${HCINDI_LIB} ${X11_LIBRARIES} ${X11_XTest_LIB} )

install(TARGETS PolarAlign RUNTIME DESTINATION bin)
